package org.eddy.wechar_sys.temp;

import java.util.HashMap;

public class CharCount {
    public static void main(String[] args) {
        strcount("asdzxcasdddddaa" );
    }
    public static  void strcount(String str){
        HashMap<String,Integer> hashMap = new HashMap<>();
        for (char c: str.toCharArray()) {
            String s = String.valueOf(c);
            if (hashMap.containsKey(s)){
                System.out.println(hashMap.get(s)+1);
                hashMap.put(s,hashMap.get(s)+1);
            }
            else hashMap.put(s,1);
        }
    for (String c : hashMap.keySet()){
        System.out.println(c+"----"+hashMap.get(c));
    }

    }
}
